home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / probots.arc / SUBMINI.PR < prev    next >
Text File  |  1991-04-28  |  848b  |  32 lines

  1.   PROCEDURE SubMini;
  2.  
  3.  {  Based on C-Robot HAK3 (Hunter-Killer III  a.k.a.  Submini)
  4.  
  5.     by John Hardin
  6.  
  7.     Strategy: Subminimal robot program. Scan the arena in 85 degree
  8.               increments (precession will ensure we scan the entire
  9.               arena). If we see a robot, charge at it firing continuously.
  10.               Don't worry about taking hits.
  11.  
  12.               This robot is suicidal and fratricidal, but effective. }
  13.  
  14.   VAR
  15.     dir            : Integer;
  16.     Range          : Integer;
  17.  
  18.   BEGIN { SubMini main }
  19.  
  20.     dir := 0;
  21.  
  22.     REPEAT { Until Dead or Winner }
  23.  
  24.       drive(dir, 50); { max speed that can still turn }
  25.       WHILE (scan(dir, 10) > 0) DO cannon(dir, scan(dir, 10)); { shoot at foe. }
  26.       dir := dir+85; { keep scanning }
  27.  
  28.     UNTIL Dead OR Winner;
  29.  
  30.   END; { end of SubMini main }
  31.  
  32.